
SELECT NATUREZA_OPERACAO_CODIGO FROM LOJA_NOTA_FISCAL
WHERE CODIGO_FILIAL = '000141' AND NF_NUMERO = '000341'

SELECT CODIGO_FISCAL_OPERACAO FROM LOJA_NOTA_FISCAL_ITEM 
WHERE CODIGO_FILIAL = '000141' AND NF_NUMERO = '000341'


UPDATE LOJA_NOTA_FISCAL SET NATUREZA_OPERACAO_CODIGO = '5.152' 
WHERE CODIGO_FILIAL = '000141' AND NF_NUMERO = '000341'

UPDATE LOJA_NOTA_FISCAL_ITEM SET CODIGO_FISCAL_OPERACAO = '6557' 
WHERE CODIGO_FILIAL = '000095' AND NF_NUMERO = '001283'

--------------- -------------------------- ----------------------------
SELECT * FROM LOJA_NOTA_FISCAL_ITEM
WHERE CODIGO_FILIAL = '000024' 
AND NF_NUMERO like '011349' 
AND CODIGO_ITEM = 'V7MTZ3975048'                                      

/*
begin transaction
UPDATE LOJA_NOTA_FISCAL_item SET indicador_cfop = '20'
WHERE CODIGO_FILIAL = '000031' AND NF_NUMERO like '002447'AND CODIGO_ITEM = 'V7MTZ3975048'   
commit
rollback                                   
*/

-------------- --------------------- --------------- ---------------- -------------------
SELECT * FROM FATURAMENTO_IMAGEM
WHERE SUBSTRING(FILIAL,1,3) = '527' 
AND NUMERO_FISCAL like '%3437'

SELECT * FROM LOJA_NOTA_FISCAL
WHERE CODIGO_FILIAL = '000527' 
AND NF_NUMERO like '003427'


/*
begin transaction
UPDATE LOJA_NOTA_FISCAL_ITEM SET preco_unitario = '0.01'
WHERE CODIGO_FILIAL = '000107' AND NF_NUMERO like '002969'AND CODIGO_ITEM = 'I8MVH01'
commit
rollback
*/

begin transaction
UPDATE LOJA_NOTA_FISCAL_IMPOSTO SET TAXA_IMPOSTO = '18.00'
WHERE CODIGO_FILIAL = '000005' AND NF_NUMERO like '021103'AND ITEM_IMPRESSAO = '0002'
commit
rollback